package com.struts.action;

import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.ModelDriven;
import com.struts.metier.User;
import com.struts.service.UserService;

public class InscriptionAction extends ActionSupport implements ModelDriven<User> {
 
	private static final long serialVersionUID = 1L;
	
	private UserService userService;
	private User user = new User();
	 
	@Override
	public User getModel() { 
		return user;
	}

	public UserService getUserService() {
		return userService;
	}

	public void setUserService(UserService userService) {
		this.userService = userService;
	}

	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}
	
	public String inscription(){
		userService.addUser(user);
		return SUCCESS;
	}
	
}
